package cn.ym.ymcc.feign;


import cn.ym.ymcc.domain.User;
import cn.ym.ymcc.fallback.UserFeignFallback;
import cn.ym.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author 86182
 */
@FeignClient(name = "service-user",fallbackFactory = UserFeignFallback.class )
public interface UserFeignClient {

    /**通过电话号码查询是否注册过*/
    @GetMapping(value = "/user/findByPhone/{phone}")
    public JSONResult findByPhone(@PathVariable("phone") String phone);

    @PostMapping("/user/patchQuery")
    public List<User> patchQuery(@RequestBody List<Long> ids);

    /**
     * 获取对象
     */
    @GetMapping(value = "/user/{id}")
    public JSONResult get(@PathVariable("id")Long id);

}
